package com.tools.common.object.string;

import com.tools.common.container.JsonPair;
import com.tools.common.exception.service.ValidException;
import com.tools.common.object.Note;
import com.tools.common.object.ObjKit;

import java.util.Iterator;
import java.util.Objects;

/**
 * 字符串校验工具类
 * 验证字符串是否符合各自各样的规范
 * 其中大部分方法用到了正则表达式
 * */
@Note("字符串校验工具类，验证字符串是否符合各自各样的规范" +
        "其中大部分方法用到了正则表达式")
public final class VerifyKit {

    private VerifyKit() {}

    /* ************************************************************************************************************
     *
     *          是否是
     *
     * ************************************************************************************************************
     * */

    @Note("判断字符串是否是 JSON 对象类型")
    public static boolean isJsonObject(String s) {
        return private_checkNotEmpty(s) && s.startsWith("{") && s.endsWith("}");
    }

    public static boolean isAllJsonObject(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(!isJsonObject(str)) return false;
        return true;
    }

    public static boolean isAllJsonObject(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(!isJsonObject(iterator.next())) return false;
        return true;
    }

    public static boolean isAnyJsonObject(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(isJsonObject(str)) return true;
        return false;
    }

    public static boolean isAnyJsonObject(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(isJsonObject(iterator.next())) return true;
        return false;
    }

    @Note("判断字符串是否是 JSON 数组类型")
    public static boolean isJsonArray(String s) {
        return private_checkNotEmpty(s) && s.startsWith("[") && s.endsWith("]");
    }

    public static boolean isAllJsonArray(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(!isJsonArray(str)) return false;
        return true;
    }

    public static boolean isAllJsonArray(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(!isJsonArray(iterator.next())) return false;
        return true;
    }

    public static boolean isAnyJsonArray(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(isJsonArray(str)) return true;
        return false;
    }

    public static boolean isAnyJsonArray(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(isJsonArray(iterator.next())) return true;
        return false;
    }

    @Note("判断字符串是否是 JSON 字符串")
    public static boolean isJsonString(String s) {
        return private_checkNotEmpty(s) && (isJsonObject(s) || isJsonArray(s));
    }

    public static boolean isAllJsonString(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(!isJsonString(str)) return false;
        return true;
    }

    public static boolean isAllJsonString(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(!isJsonString(iterator.next())) return false;
        return true;
    }

    public static boolean isAnyJsonString(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(isJsonString(str)) return true;
        return false;
    }

    public static boolean isAnyJsonString(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(isJsonString(iterator.next())) return true;
        return false;
    }

    @Note("判断字符串是否是整数，这个整数可以是负数")
    public static boolean isInt(String s) {
        if(isInteger(s)) {
            return true;
        }
        if(s == null || s.length() < 2) {
            return false;
        }
        char c1 = s.charAt(0);
        if(c1 != '-' && c1 != '+') {
            return false;
        }
        String newStr = s.substring(1);
        return isInteger(newStr);
    }


    public static boolean isAllInt(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(!isInt(str)) return false;
        return true;
    }

    public static boolean isAllInt(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(!isInt(iterator.next())) return false;
        return true;
    }

    public static boolean isAnyInt(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(isInt(str)) return true;
        return false;
    }

    public static boolean isAnyInt(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(isInt(iterator.next())) return true;
        return false;
    }

    @Note("判断字符串是否是布尔值")
    public static boolean isBoolean(String s) {
        return private_checkNotEmpty(s) && (s.equalsIgnoreCase("true") || s.equalsIgnoreCase("false"));
    }

    public static boolean isAllBoolean(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(!isBoolean(str)) return false;
        return true;
    }

    public static boolean isAllBoolean(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(!isBoolean(iterator.next())) return false;
        return true;
    }

    public static boolean isAnyBoolean(String... s) {
        if(s == null || s.length == 0) return false;
        for (String str : s) if(isBoolean(str)) return true;
        return false;
    }

    public static boolean isAnyBoolean(Iterable<String> s) {
        if(s == null) return false;
        Iterator<String> iterator = s.iterator();
        if(!iterator.hasNext()) return false;
        while (iterator.hasNext()) if(isBoolean(iterator.next())) return true;
        return false;
    }

    @Note("判断字符串是否是正整数")
    public static boolean isInteger(String s) {
        return RegEnum.IS_INTEGER.match(s);
    }

    public static boolean isAllInteger(String... s) {
        return RegEnum.IS_INTEGER.matchAll(s);
    }

    public static boolean isAllInteger(Iterable<String> s) {
        return RegEnum.IS_INTEGER.matchAll(s);
    }

    public static boolean isAnyInteger(String... s) {
        return RegEnum.IS_INTEGER.matchAny(s);
    }

    public static boolean isAnyInteger(Iterable<String> s) {
        return RegEnum.IS_INTEGER.matchAny(s);
    }

    @Note("判断字符串是否是小数")
    public static boolean isFloat(String s) {
        return RegEnum.IS_FLOAT.match(s);
    }

    public static boolean isAllFloat(String... s) {
        return RegEnum.IS_FLOAT.matchAll(s);
    }

    public static boolean isAllFloat(Iterable<String> s) {
        return RegEnum.IS_FLOAT.matchAll(s);
    }

    public static boolean isAnyFloat(String... s) {
        return RegEnum.IS_FLOAT.matchAny(s);
    }

    public static boolean isAnyFloat(Iterable<String> s) {
        return RegEnum.IS_FLOAT.matchAny(s);
    }

    @Note("判断字符串是否全是小写字母")
    public static boolean isLowercase(String s) {
        return RegEnum.IS_LOWERCASE.match(s);
    }

    public static boolean isAllLowercase(String... s) {
        return RegEnum.IS_LOWERCASE.matchAll(s);
    }

    public static boolean isAllLowercase(Iterable<String> s) {
        return RegEnum.IS_LOWERCASE.matchAll(s);
    }

    public static boolean isAnyLowercase(String... s) {
        return RegEnum.IS_LOWERCASE.matchAny(s);
    }

    public static boolean isAnyLowercase(Iterable<String> s) {
        return RegEnum.IS_LOWERCASE.matchAny(s);
    }

    @Note("判断字符串是否全是大写字母")
    public static boolean isUppercase(String s) {
        return RegEnum.IS_UPPERCASE.match(s);
    }

    public static boolean isAllUppercase(String... s) {
        return RegEnum.IS_UPPERCASE.matchAll(s);
    }

    public static boolean isAllUppercase(Iterable<String> s) {
        return RegEnum.IS_UPPERCASE.matchAll(s);
    }

    public static boolean isAnyUppercase(String... s) {
        return RegEnum.IS_UPPERCASE.matchAny(s);
    }

    public static boolean isAnyUppercase(Iterable<String> s) {
        return RegEnum.IS_UPPERCASE.matchAny(s);
    }

    @Note("判断字符串是否全是英文特殊字符")
    public static boolean isEnSpecial(String s) {
        return RegEnum.IS_EN_SPECIAL.match(s);
    }

    public static boolean isAllEnSpecial(String... s) {
        return RegEnum.IS_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAllEnSpecial(Iterable<String> s) {
        return RegEnum.IS_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyEnSpecial(String... s) {
        return RegEnum.IS_EN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyEnSpecial(Iterable<String> s) {
        return RegEnum.IS_EN_SPECIAL.matchAny(s);
    }

    @Note("判断字符串是否全是中文特殊字符")
    public static boolean isCnSpecial(String s) {
        return RegEnum.IS_CN_SPECIAL.match(s);
    }

    public static boolean isAllCnSpecial(String... s) {
        return RegEnum.IS_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAllCnSpecial(Iterable<String> s) {
        return RegEnum.IS_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyCnSpecial(String... s) {
        return RegEnum.IS_CN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyCnSpecial(Iterable<String> s) {
        return RegEnum.IS_CN_SPECIAL.matchAny(s);
    }

    @Note("判断字符串是否全是中文")
    public static boolean isChinese(String s) {
        return RegEnum.IS_CHINESE.match(s);
    }

    public static boolean isAllChinese(String... s) {
        return RegEnum.IS_CHINESE.matchAll(s);
    }

    public static boolean isAllChinese(Iterable<String> s) {
        return RegEnum.IS_CHINESE.matchAll(s);
    }

    public static boolean isAnyChinese(String... s) {
        return RegEnum.IS_CHINESE.matchAny(s);
    }

    public static boolean isAnyChinese(Iterable<String> s) {
        return RegEnum.IS_CHINESE.matchAny(s);
    }

    @Note("判断字符串是否是邮箱地址")
    public static boolean isEmail(String s) {
        return RegEnum.IS_EMAIL.match(s);
    }

    public static boolean isAllEmail(String... s) {
        return RegEnum.IS_EMAIL.matchAll(s);
    }

    public static boolean isAllEmail(Iterable<String> s) {
        return RegEnum.IS_EMAIL.matchAll(s);
    }

    public static boolean isAnyEmail(String... s) {
        return RegEnum.IS_EMAIL.matchAny(s);
    }

    public static boolean isAnyEmail(Iterable<String> s) {
        return RegEnum.IS_EMAIL.matchAny(s);
    }

    @Note("判断字符串是否是 URL 链接")
    public static boolean isUrl(String s) {
        return RegEnum.IS_URL.match(s);
    }

    public static boolean isAllUrl(String... s) {
        return RegEnum.IS_URL.matchAll(s);
    }

    public static boolean isAllUrl(Iterable<String> s) {
        return RegEnum.IS_URL.matchAll(s);
    }

    public static boolean isAnyUrl(String... s) {
        return RegEnum.IS_URL.matchAny(s);
    }

    public static boolean isAnyUrl(Iterable<String> s) {
        return RegEnum.IS_URL.matchAny(s);
    }

    @Note("判断字符串是否是 【IP:端口】 的格式")
    public static boolean isHostAndPort(String s) {
        return RegEnum.IS_HOST_AND_PORT.match(s);
    }

    public static boolean isAllHostAndPort(String... s) {
        return RegEnum.IS_HOST_AND_PORT.matchAll(s);
    }

    public static boolean isAllHostAndPort(Iterable<String> s) {
        return RegEnum.IS_HOST_AND_PORT.matchAll(s);
    }

    public static boolean isAnyHostAndPort(String... s) {
        return RegEnum.IS_HOST_AND_PORT.matchAny(s);
    }

    public static boolean isAnyHostAndPort(Iterable<String> s) {
        return RegEnum.IS_HOST_AND_PORT.matchAny(s);
    }

    @Note("判断字符串是否是端口")
    public static boolean isPort(String s) {
        return RegEnum.IS_PORT.match(s);
    }

    public static boolean isAllPort(String... s) {
        return RegEnum.IS_PORT.matchAll(s);
    }

    public static boolean isAllPort(Iterable<String> s) {
        return RegEnum.IS_PORT.matchAll(s);
    }

    public static boolean isAnyPort(String... s) {
        return RegEnum.IS_PORT.matchAny(s);
    }

    public static boolean isAnyPort(Iterable<String> s) {
        return RegEnum.IS_PORT.matchAny(s);
    }

    @Note("判断字符串是否是 IPv4 地址")
    public static boolean isIPv4(String s) {
        return RegEnum.IS_IPV4.match(s);
    }

    public static boolean isAllIPv4(String... s) {
        return RegEnum.IS_IPV4.matchAll(s);
    }

    public static boolean isAllIPv4(Iterable<String> s) {
        return RegEnum.IS_IPV4.matchAll(s);
    }

    public static boolean isAnyIPv4(String... s) {
        return RegEnum.IS_IPV4.matchAny(s);
    }

    public static boolean isAnyIPv4(Iterable<String> s) {
        return RegEnum.IS_IPV4.matchAny(s);
    }

    @Note("判断字符串是否是 IPv6 地址")
    public static boolean isIPv6(String s) {
        return RegEnum.IS_IPV6.match(s);
    }

    public static boolean isAllIPv6(String... s) {
        return RegEnum.IS_IPV6.matchAll(s);
    }

    public static boolean isAllIPv6(Iterable<String> s) {
        return RegEnum.IS_IPV6.matchAll(s);
    }

    public static boolean isAnyIPv6(String... s) {
        return RegEnum.IS_IPV6.matchAny(s);
    }

    public static boolean isAnyIPv6(Iterable<String> s) {
        return RegEnum.IS_IPV6.matchAny(s);
    }

    @Note("判断字符串是否是手机号码（严格判断）")
    public static boolean isPhoneStrict(String s) {
        return RegEnum.IS_PHONE_STRICT.match(s);
    }

    public static boolean isAllPhoneStrict(String... s) {
        return RegEnum.IS_PHONE_STRICT.matchAll(s);
    }

    public static boolean isAllPhoneStrict(Iterable<String> s) {
        return RegEnum.IS_PHONE_STRICT.matchAll(s);
    }

    public static boolean isAnyPhoneStrict(String... s) {
        return RegEnum.IS_PHONE_STRICT.matchAny(s);
    }

    public static boolean isAnyPhoneStrict(Iterable<String> s) {
        return RegEnum.IS_PHONE_STRICT.matchAny(s);
    }

    @Note("判断字符串是否是手机号码（宽松判断）")
    public static boolean isPhoneLoose(String s) {
        return RegEnum.IS_PHONE_LOOSE.match(s);
    }

    public static boolean isAllPhoneLoose(String... s) {
        return RegEnum.IS_PHONE_LOOSE.matchAll(s);
    }

    public static boolean isAllPhoneLoose(Iterable<String> s) {
        return RegEnum.IS_PHONE_LOOSE.matchAll(s);
    }

    public static boolean isAnyPhoneLoose(String... s) {
        return RegEnum.IS_PHONE_LOOSE.matchAny(s);
    }

    public static boolean isAnyPhoneLoose(Iterable<String> s) {
        return RegEnum.IS_PHONE_LOOSE.matchAny(s);
    }

    @Note("判断字符串是否是座机号码")
    public static boolean isTelePhone(String s) {
        return RegEnum.IS_TELE.match(s);
    }

    public static boolean isAllTelePhone(String... s) {
        return RegEnum.IS_TELE.matchAll(s);
    }

    public static boolean isAllTelePhone(Iterable<String> s) {
        return RegEnum.IS_TELE.matchAll(s);
    }

    public static boolean isAnyTelePhone(String... s) {
        return RegEnum.IS_TELE.matchAny(s);
    }

    public static boolean isAnyTelePhone(Iterable<String> s) {
        return RegEnum.IS_TELE.matchAny(s);
    }

    @Note("判断字符串是否是 QQ 号")
    public static boolean isQQ(String s) {
        return RegEnum.IS_QQ.match(s);
    }

    public static boolean isAllQQ(String... s) {
        return RegEnum.IS_QQ.matchAll(s);
    }

    public static boolean isAllQQ(Iterable<String> s) {
        return RegEnum.IS_QQ.matchAll(s);
    }

    public static boolean isAnyQQ(String... s) {
        return RegEnum.IS_QQ.matchAny(s);
    }

    public static boolean isAnyQQ(Iterable<String> s) {
        return RegEnum.IS_QQ.matchAny(s);
    }

    @Note("判断字符串是否是身份证号码")
    public static boolean isID(String s) {
        return RegEnum.IS_ID.match(s);
    }

    public static boolean isAllID(String... s) {
        return RegEnum.IS_ID.matchAll(s);
    }

    public static boolean isAllID(Iterable<String> s) {
        return RegEnum.IS_ID.matchAll(s);
    }

    public static boolean isAnyID(String... s) {
        return RegEnum.IS_ID.matchAny(s);
    }

    public static boolean isAnyID(Iterable<String> s) {
        return RegEnum.IS_ID.matchAny(s);
    }

    @Note("判断字符串是否是银行卡号码")
    public static boolean isBankCardCode(String s) {
        return RegEnum.IS_BANK_CODE.match(s);
    }

    public static boolean isAllBankCardCode(String... s) {
        return RegEnum.IS_BANK_CODE.matchAll(s);
    }

    public static boolean isAllBankCardCode(Iterable<String> s) {
        return RegEnum.IS_BANK_CODE.matchAll(s);
    }

    public static boolean isAnyBankCardCode(String... s) {
        return RegEnum.IS_BANK_CODE.matchAny(s);
    }

    public static boolean isAnyBankCardCode(Iterable<String> s) {
        return RegEnum.IS_BANK_CODE.matchAny(s);
    }

    @Note("判断字符串是否是邮政编码")
    public static boolean isPostCode(String s) {
        return RegEnum.IS_POST_CODE.match(s);
    }

    public static boolean isAllPostCode(String... s) {
        return RegEnum.IS_POST_CODE.matchAll(s);
    }

    public static boolean isAllPostCode(Iterable<String> s) {
        return RegEnum.IS_POST_CODE.matchAll(s);
    }

    public static boolean isAnyPostCode(String... s) {
        return RegEnum.IS_POST_CODE.matchAny(s);
    }

    public static boolean isAnyPostCode(Iterable<String> s) {
        return RegEnum.IS_POST_CODE.matchAny(s);
    }

    @Note("判断字符串是否是车牌号")
    public static boolean isCarCode(String s) {
        return RegEnum.IS_CAR_CODE.match(s);
    }

    public static boolean isAllCarCode(String... s) {
        return RegEnum.IS_CAR_CODE.matchAll(s);
    }

    public static boolean isAllCarCode(Iterable<String> s) {
        return RegEnum.IS_CAR_CODE.matchAll(s);
    }

    public static boolean isAnyCarCode(String... s) {
        return RegEnum.IS_CAR_CODE.matchAny(s);
    }

    public static boolean isAnyCarCode(Iterable<String> s) {
        return RegEnum.IS_CAR_CODE.matchAny(s);
    }

    @Note("判断字符串是否是车牌号")
    public static boolean isMAC(String s) {
        return RegEnum.IS_MAC1.match(s) || RegEnum.IS_MAC2.match(s);
    }

    public static boolean isAllMAC(String... s) {
        return RegEnum.IS_MAC1.matchAll(s) || RegEnum.IS_MAC2.matchAll(s);
    }

    public static boolean isAllMAC(Iterable<String> s) {
        return RegEnum.IS_MAC1.matchAll(s) || RegEnum.IS_MAC2.matchAll(s);
    }

    public static boolean isAnyMAC(String... s) {
        return RegEnum.IS_MAC1.matchAny(s) || RegEnum.IS_MAC2.matchAny(s);
    }

    public static boolean isAnyMAC(Iterable<String> s) {
        return RegEnum.IS_MAC1.matchAny(s) || RegEnum.IS_MAC2.matchAny(s);
    }

    /* ************************************************************************************************************
     *
     *          包含
     *
     * ************************************************************************************************************
     * */

    @Note("判断字符串是否包含中文")
    public static boolean containsChinese(String s) {
        return RegEnum.CONTAINS_CHINESE.match(s);
    }

    public static boolean isAllContainsChinese(String... s) {
        return RegEnum.CONTAINS_CHINESE.matchAll(s);
    }

    public static boolean isAllContainsChinese(Iterable<String> s) {
        return RegEnum.CONTAINS_CHINESE.matchAll(s);
    }

    public static boolean isAnyContainsChinese(String... s) {
        return RegEnum.CONTAINS_CHINESE.matchAny(s);
    }

    public static boolean isAnyContainsChinese(Iterable<String> s) {
        return RegEnum.CONTAINS_CHINESE.matchAny(s);
    }

    @Note("判断字符串是否包含数字")
    public static boolean containsNumber(String s) {
        return RegEnum.CONTAINS_NUMBER.match(s);
    }

    public static boolean isAllContainsNumber(String... s) {
        return RegEnum.CONTAINS_NUMBER.matchAll(s);
    }

    public static boolean isAllContainsNumber(Iterable<String> s) {
        return RegEnum.CONTAINS_NUMBER.matchAll(s);
    }

    public static boolean isAnyContainsNumber(String... s) {
        return RegEnum.CONTAINS_NUMBER.matchAny(s);
    }

    public static boolean isAnyContainsNumber(Iterable<String> s) {
        return RegEnum.CONTAINS_NUMBER.matchAny(s);
    }

    @Note("判断字符串是否包含小写字母")
    public static boolean containsLowercase(String s) {
        return RegEnum.CONTAINS_LOWERCASE.match(s);
    }

    public static boolean isAllContainsLowercase(String... s) {
        return RegEnum.CONTAINS_LOWERCASE.matchAll(s);
    }

    public static boolean isAllContainsLowercase(Iterable<String> s) {
        return RegEnum.CONTAINS_LOWERCASE.matchAll(s);
    }

    public static boolean isAnyContainsLowercase(String... s) {
        return RegEnum.CONTAINS_LOWERCASE.matchAny(s);
    }

    public static boolean isAnyContainsLowercase(Iterable<String> s) {
        return RegEnum.CONTAINS_LOWERCASE.matchAny(s);
    }

    @Note("判断字符串是否包含大写字母")
    public static boolean containsUppercase(String s) {
        return RegEnum.CONTAINS_UPPERCASE.match(s);
    }

    public static boolean isAllContainsUppercase(String... s) {
        return RegEnum.CONTAINS_UPPERCASE.matchAll(s);
    }

    public static boolean isAllContainsUppercase(Iterable<String> s) {
        return RegEnum.CONTAINS_UPPERCASE.matchAll(s);
    }

    public static boolean isAnyContainsUppercase(String... s) {
        return RegEnum.CONTAINS_UPPERCASE.matchAny(s);
    }

    public static boolean isAnyContainsUppercase(Iterable<String> s) {
        return RegEnum.CONTAINS_UPPERCASE.matchAny(s);
    }

    @Note("判断字符串是否包含英文特殊字符")
    public static boolean containsEnSpecial(String s) {
        return RegEnum.CONTAINS_EN_SPECIAL.match(s);
    }

    public static boolean isAllContainsEnSpecial(String... s) {
        return RegEnum.CONTAINS_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAllContainsEnSpecial(Iterable<String> s) {
        return RegEnum.CONTAINS_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyContainsEnSpecial(String... s) {
        return RegEnum.CONTAINS_EN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyContainsEnSpecial(Iterable<String> s) {
        return RegEnum.CONTAINS_EN_SPECIAL.matchAny(s);
    }

    @Note("判断字符串是否包含中文特殊字符")
    public static boolean containsCnSpecial(String s) {
        return RegEnum.CONTAINS_CN_SPECIAL.match(s);
    }

    public static boolean isAllContainsCnSpecial(String... s) {
        return RegEnum.CONTAINS_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAllContainsCnSpecial(Iterable<String> s) {
        return RegEnum.CONTAINS_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyContainsCnSpecial(String... s) {
        return RegEnum.CONTAINS_CN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyContainsCnSpecial(Iterable<String> s) {
        return RegEnum.CONTAINS_CN_SPECIAL.matchAny(s);
    }

    /* ************************************************************************************************************
     *
     *          开头
     *
     * ************************************************************************************************************
     * */

    @Note("判断字符串是否是数字开头")
    public static boolean beginNumber(String s) {
        return RegEnum.BEGIN_NUMBER.match(s);
    }

    public static boolean isAllBeginNumber(String... s) {
        return RegEnum.BEGIN_NUMBER.matchAll(s);
    }

    public static boolean isAllBeginNumber(Iterable<String> s) {
        return RegEnum.BEGIN_NUMBER.matchAll(s);
    }

    public static boolean isAnyBeginNumber(String... s) {
        return RegEnum.BEGIN_NUMBER.matchAny(s);
    }

    public static boolean isAnyBeginNumber(Iterable<String> s) {
        return RegEnum.BEGIN_NUMBER.matchAny(s);
    }

    @Note("判断字符串是否是小写字母开头")
    public static boolean beginLowercase(String s) {
        return RegEnum.BEGIN_LOWERCASE.match(s);
    }

    public static boolean isAllBeginLowercase(String... s) {
        return RegEnum.BEGIN_LOWERCASE.matchAll(s);
    }

    public static boolean isAllBeginLowercase(Iterable<String> s) {
        return RegEnum.BEGIN_LOWERCASE.matchAll(s);
    }

    public static boolean isAnyBeginLowercase(String... s) {
        return RegEnum.BEGIN_LOWERCASE.matchAny(s);
    }

    public static boolean isAnyBeginLowercase(Iterable<String> s) {
        return RegEnum.BEGIN_LOWERCASE.matchAny(s);
    }

    @Note("判断字符串是否是大写字母开头")
    public static boolean beginUppercase(String s) {
        return RegEnum.BEGIN_UPPERCASE.match(s);
    }

    public static boolean isAllBeginUppercase(String... s) {
        return RegEnum.BEGIN_UPPERCASE.matchAll(s);
    }

    public static boolean isAllBeginUppercase(Iterable<String> s) {
        return RegEnum.BEGIN_UPPERCASE.matchAll(s);
    }

    public static boolean isAnyBeginUppercase(String... s) {
        return RegEnum.BEGIN_UPPERCASE.matchAny(s);
    }

    public static boolean isAnyBeginUppercase(Iterable<String> s) {
        return RegEnum.BEGIN_UPPERCASE.matchAny(s);
    }

    @Note("判断字符串是否是英文特殊字符开头")
    public static boolean beginEnSpecial(String s) {
        return RegEnum.BEGIN_EN_SPECIAL.match(s);
    }

    public static boolean isAllBeginEnSpecial(String... s) {
        return RegEnum.BEGIN_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAllBeginEnSpecial(Iterable<String> s) {
        return RegEnum.BEGIN_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyBeginEnSpecial(String... s) {
        return RegEnum.BEGIN_EN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyBeginEnSpecial(Iterable<String> s) {
        return RegEnum.BEGIN_EN_SPECIAL.matchAny(s);
    }

    @Note("判断字符串是否是中文特殊字符开头")
    public static boolean beginCnSpecial(String s) {
        return RegEnum.BEGIN_CN_SPECIAL.match(s);
    }

    public static boolean isAllBeginCnSpecial(String... s) {
        return RegEnum.BEGIN_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAllBeginCnSpecial(Iterable<String> s) {
        return RegEnum.BEGIN_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyBeginCnSpecial(String... s) {
        return RegEnum.BEGIN_CN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyBeginCnSpecial(Iterable<String> s) {
        return RegEnum.BEGIN_CN_SPECIAL.matchAny(s);
    }

    @Note("判断字符串是否是中文开头")
    public static boolean beginChinese(String s) {
        return RegEnum.BEGIN_CHINESE.match(s);
    }

    public static boolean isAllBeginChinese(String... s) {
        return RegEnum.BEGIN_CHINESE.matchAll(s);
    }

    public static boolean isAllBeginChinese(Iterable<String> s) {
        return RegEnum.BEGIN_CHINESE.matchAll(s);
    }

    public static boolean isAnyBeginChinese(String... s) {
        return RegEnum.BEGIN_CHINESE.matchAny(s);
    }

    public static boolean isAnyBeginChinese(Iterable<String> s) {
        return RegEnum.BEGIN_CHINESE.matchAny(s);
    }

    /* ************************************************************************************************************
     *
     *          结尾
     *
     * ************************************************************************************************************
     * */

    @Note("判断字符串是否是数字结尾")
    public static boolean endNumber(String s) {
        return RegEnum.END_NUMBER.match(s);
    }

    public static boolean isAllEndNumber(String... s) {
        return RegEnum.END_NUMBER.matchAll(s);
    }

    public static boolean isAllEndNumber(Iterable<String> s) {
        return RegEnum.END_NUMBER.matchAll(s);
    }

    public static boolean isAnyEndNumber(String... s) {
        return RegEnum.END_NUMBER.matchAny(s);
    }

    public static boolean isAnyEndNumber(Iterable<String> s) {
        return RegEnum.END_NUMBER.matchAny(s);
    }

    @Note("判断字符串是否是小写字母结尾")
    public static boolean endLowercase(String s) {
        return RegEnum.END_LOWERCASE.match(s);
    }

    public static boolean isAllEndLowercase(String... s) {
        return RegEnum.END_LOWERCASE.matchAll(s);
    }

    public static boolean isAllEndLowercase(Iterable<String> s) {
        return RegEnum.END_LOWERCASE.matchAll(s);
    }

    public static boolean isAnyEndLowercase(String... s) {
        return RegEnum.END_LOWERCASE.matchAny(s);
    }

    public static boolean isAnyEndLowercase(Iterable<String> s) {
        return RegEnum.END_LOWERCASE.matchAny(s);
    }

    @Note("判断字符串是否是大写字母结尾")
    public static boolean endUppercase(String s) {
        return RegEnum.END_UPPERCASE.match(s);
    }

    public static boolean isAllEndUppercase(String... s) {
        return RegEnum.END_UPPERCASE.matchAll(s);
    }

    public static boolean isAllEndUppercase(Iterable<String> s) {
        return RegEnum.END_UPPERCASE.matchAll(s);
    }

    public static boolean isAnyEndUppercase(String... s) {
        return RegEnum.END_UPPERCASE.matchAny(s);
    }

    public static boolean isAnyEndUppercase(Iterable<String> s) {
        return RegEnum.END_UPPERCASE.matchAny(s);
    }

    @Note("判断字符串是否是英文特殊字符结尾")
    public static boolean endEnSpecial(String s) {
        return RegEnum.END_EN_SPECIAL.match(s);
    }

    public static boolean isAllEndEnSpecial(String... s) {
        return RegEnum.END_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAllEndEnSpecial(Iterable<String> s) {
        return RegEnum.END_EN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyEndEnSpecial(String... s) {
        return RegEnum.END_EN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyEndEnSpecial(Iterable<String> s) {
        return RegEnum.END_EN_SPECIAL.matchAny(s);
    }

    @Note("判断字符串是否是中文特殊字符结尾")
    public static boolean endCnSpecial(String s) {
        return RegEnum.END_CN_SPECIAL.match(s);
    }

    public static boolean isAllEndCnSpecial(String... s) {
        return RegEnum.END_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAllEndCnSpecial(Iterable<String> s) {
        return RegEnum.END_CN_SPECIAL.matchAll(s);
    }

    public static boolean isAnyEndCnSpecial(String... s) {
        return RegEnum.END_CN_SPECIAL.matchAny(s);
    }

    public static boolean isAnyEndCnSpecial(Iterable<String> s) {
        return RegEnum.END_CN_SPECIAL.matchAny(s);
    }

    @Note("判断字符串是否是中文结尾")
    public static boolean endChinese(String s) {
        return RegEnum.END_CHINESE.match(s);
    }

    public static boolean isAllEndChinese(String... s) {
        return RegEnum.END_CHINESE.matchAll(s);
    }

    public static boolean isAllEndChinese(Iterable<String> s) {
        return RegEnum.END_CHINESE.matchAll(s);
    }

    public static boolean isAnyEndChinese(String... s) {
        return RegEnum.END_CHINESE.matchAny(s);
    }

    public static boolean isAnyEndChinese(Iterable<String> s) {
        return RegEnum.END_CHINESE.matchAny(s);
    }

    /* ************************************************************************************************************
     *
     *          其他
     *
     * ************************************************************************************************************
     * */

    @Note("condition 条件必须为 true 才能通过，否则就抛异常")
    public static void checkIsTrue(boolean condition, JsonPair response) {
        if(!condition) throw new ValidException(response);
    }

    @Note("condition 条件必须为 false 才能通过，否则就抛异常")
    public static void checkIsFalse(boolean condition, JsonPair response) {
        if(condition) throw new ValidException(response);
    }

    @Note("o 必须在 objs 里才会返回 true")
    public static boolean checkIn(Object o, Object[] objs) {
        return ObjKit.equalsAny(o, objs);
    }

    @Note("o 必须不在 objs 里才会返回 true")
    public static boolean checkNotIn(Object o, Object[] objs) {
        if(objs == null || objs.length == 0) return false;
        for (Object obj : objs) if(Objects.equals(o, obj)) return false;
        return true;
    }

    /* ************************************************************************************************************
     *
     *          私有逻辑
     *
     * ************************************************************************************************************
     * */

    @Note("检查字符串 s 是否不为空")
    private static boolean private_checkNotEmpty(String s) {
        return s != null && !s.isEmpty();
    }
}
